<?php
session_start();

require_once("../database.include.php");

	$groupname=$_GET["groupname"];

	/* Delete all rows from the group table */
	$count = $conn->exec("DELETE FROM `group` WHERE `name` = '" . $groupname . "'");
	/* Return number of rows that were deleted */
	echo "Deleted $count rows in group.\n";

	/* Delete all rows from the group_user table */
	$count = $conn->exec("DELETE FROM `group_user` WHERE `group_name` = '" . $groupname . "'");
	/* Return number of rows that were deleted */
	echo "Deleted $count rows in group_user.\n";

	/* Delete all rows from the message table */
	$count = $conn->exec("DELETE FROM `message` WHERE `group_name` = '" . $groupname . "'");
	/* Return number of rows that were deleted */
	echo "Deleted $count rows in message.\n";

	/* Delete all rows from the group_invitation table */
	$count = $conn->exec("DELETE FROM `group_invitation` WHERE `group_name` = '" . $groupname . "'");
	/* Return number of rows that were deleted */
	echo "Deleted $count rows in group_invitation.\n";

?>
